package com.yu.shaungxuan.controller;


import com.yu.shaungxuan.model.common.Result;
import com.yu.shaungxuan.model.dto.StudentLoginInfo;
import com.yu.shaungxuan.service.StudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@Api(tags = "学生相关接口")
@RequestMapping("/student")
public class StudentController {

    @Resource
    private StudentService studentService;

    @PostMapping("/login")
    @ApiOperation(value = "学生登录")
    public Result<String> studentLogin(@RequestBody StudentLoginInfo studentLoginInfo) {
        return studentService.login(studentLoginInfo);
    }

    @GetMapping("/choiceTeacher")
    @ApiOperation(value = "学生选择老师功能")
    public Result<String> choiceTeacher(String teacherIds) {
        return studentService.choice(teacherIds);
    }

    @PostMapping("/logout")
    @ApiOperation(value = "学生退出登录")
    private  Result<String> logout() {
        return studentService.logout();
    }


}
